﻿-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[proc_P_GetList] 
	(
	@startIndex nvarchar(20),
	@endIndex nvarchar(20)
--	@docount bit,
--	@username nvarchar (50),
--	@unitId nvarchar(4),            --单位
--	@departmentId varchar(8000),   --部门
--	@grade nvarchar(4),             --职级 
--	@state nvarchar(10),             --状态
--	@sex nvarchar(4),		--性别
--	@name nvarchar(50)	        --姓名
)
AS
BEGIN
declare @sql1 nvarchar (4000)

	SET NOCOUNT ON
	set @sql1='
select * from 

(select *,  ROW_NUMBER() over(order by id) as row ,(select count(id) from employee where id>10) as zjls,
ceiling((select count(id) from employee where id>10)*1.0/20) as zys  
from employee where id>10 ) as newtable  where '+

--row>20*(1 - 1)   and row<=  1 * 20 
 ' row>'+@startIndex   +' and row<= '+  @endIndex 
+' and id>10   order by id	  '


  exec (@sql1)
			  print	 (@sql1)
END
